#include <stdio.h>
#include <stdlib.h>
#include<math.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(void)
{
	int N,count=0;
	scanf("%d",&N);
	int X,Y;
	
	for(X=1;X<=sqrt(N);X++){
		for(Y=1;Y<=sqrt(N);Y++){
			if((X<=Y)&&(X*X+Y*Y==N)){
				count++;
				printf("%d %d\n",X,Y);
			}
		}
	}
	
	if(count==0)
		printf("No Solution");
		
	
	
	
	
		return 0;




}